package com.aca.market.util;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

public class MD5 {

    public static String getCode(String salt, String originPwd, int hashlterations){
        //hashlterations 混淆次数
        return new SimpleHash("MD5",originPwd,ByteSource.Util.bytes(salt),hashlterations).toString();
    }

    public static void main(String[] args) {
//        ByteSource salt = ByteSource.Util.bytes("ccc@qq.com");
//        //hashlterations 混淆次数
//        SimpleHash hash = new SimpleHash("MD5","333",salt,1);
//        System.out.println(hash.toString());

        System.out.println(getCode("user","user",1));
        //f6fdffe48c908deb0f4c3bd36c032e72


    }
}
